package tt.dz.appaction.base;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Service;

/**
 * 应用程序初始化
 * @author 谢龙飞
 *
 */
@Service
public class InitWebApp implements BeanPostProcessor {

	/**防止多次操作bool类型*/
	private static boolean init = false;

	/**
	 * 在spring容易初始化之后
	 */
	@Override
	public Object postProcessAfterInitialization(Object obj, String arg1)
			throws BeansException {
		if(!init){
			init = true;
		}
		return obj;
	}

	/**
	 * 在spring初始化之前
	 */
	@Override
	public Object postProcessBeforeInitialization(Object obj, String arg1)
			throws BeansException {
		return obj;
	}

}
